package main

import (
	"content_system/infra/db"
	"gorm.io/gen"
)

func main() {
	db.Init()
	g := gen.NewGenerator(gen.Config{
		OutPath:      "./dao/def/account/query",
		ModelPkgPath: "./model",
		Mode:         gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface, // generate mode
	})
	g.UseDB(db.AccountDB) // reuse your gorm db
	g.ApplyBasic(
		// Generate struct `Employee` based on table `users`
		g.GenerateModelAs("account", "Account"),
	)
	g.Execute()

	g = gen.NewGenerator(gen.Config{
		OutPath:      "./dao/def/content/query",
		ModelPkgPath: "./model",
		Mode:         gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface, // generate mode
	})
	g.UseDB(db.ContentDB) // reuse your gorm db
	g.ApplyBasic(
		// Generate struct `Employee` based on table `users`
		g.GenerateModelAs("content", "Content"),
	)
	g.Execute()

}
